package com.blabla.controller;

import com.blabla.request.CalculationRequest;
import com.blabla.service.CalculationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yzw
 * @date 2022/1/15 10:42
 * @desc 计算入口 策略模式示意
 */
@RestController
public class CalculationController {

    @Autowired
    private CalculationService calculationService;


    @PostMapping("/calculate")
    public Integer calculate(@RequestBody CalculationRequest request){
        return calculationService.calculate(request);
    }

}
